//
//  FCMainViewController.swift
//  FinancialConsulting
//
//  Created by Max on 2017/10/26.
//  Copyright © 2017年 com.vector. All rights reserved.
//

import UIKit

class FCMainViewController: FCViewController {

    @IBOutlet weak var valueLabel: UILabel!
    @IBOutlet weak var bannerIamge: UIImageView!
    override func viewDidLoad() {
        super.viewDidLoad()

        if self.navigationItem.leftBarButtonItem != nil {
            let btn = UIButton(type: UIButtonType.custom)
            self.navigationItem.leftBarButtonItem = UIBarButtonItem(customView: btn)
        }
    }
    
    override func viewWillAppear(_ animated: Bool) {
        super.viewWillAppear(true)
        
        if FCModelData.instance.isTestCode == true {
        
           valueLabel.text = "你的信用测试已完成！"
            
            
            
        }
    }

    @IBAction func testCodeAction(_ sender: Any) {
    
        if FCModelData.instance.isLogin == false {
        
            if let v = FCLoginViewController.create() as? FCLoginViewController {
            
                v.hidesBottomBarWhenPushed = true
                self.navigationController?.pushViewController(v, animated: true)
                
            }
            
        
        }else {
        
            
            if let v = FCCreditScoreViewController.create() as? FCCreditScoreViewController {
                
                v.hidesBottomBarWhenPushed = true
                self.navigationController?.pushViewController(v, animated: true)
            }
            
        }
        
        
    }
    
    @IBAction func oneAction(_ sender: Any) {
  
        if let v = ArticleTopicViewController.create() as? ArticleTopicViewController {
          v.mark = 1
              v.hidesBottomBarWhenPushed = true
          self.navigationController?.pushViewController(v, animated: true)
        }
    }
    
    @IBAction func twoAction(_ sender: Any) {
        if let v = ArticleTopicViewController.create() as? ArticleTopicViewController {
            v.mark = 4
            v.hidesBottomBarWhenPushed = true
            self.navigationController?.pushViewController(v, animated: true)
        }
    }
    
    @IBAction func threeAction(_ sender: Any) {
    
        if let v = ArticleTopicViewController.create() as? ArticleTopicViewController {
            v.mark = 5
            v.hidesBottomBarWhenPushed = true
            self.navigationController?.pushViewController(v, animated: true)
        }
    }
    
    @IBAction func fourAction(_ sender: Any) {
    
        if let v = ArticleTopicViewController.create() as? ArticleTopicViewController {
            v.mark = 6
            v.hidesBottomBarWhenPushed = true
            self.navigationController?.pushViewController(v, animated: true)
        }
    }
    
    
    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }
    

    
}
